package com.example.healing.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.healing.entity.Comment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * @author neymar
 * @date 2021年11月30日 15:25
 */
@Mapper
@Component
public interface CommentMapper extends BaseMapper<Comment> {
    @Select("select t1.avatar," +
            "t1.username," +
            "t2.context," +
            "t2.date" +
            " from user t1,comment t2 where t1.uid = t2.uid and t2.songid = ${songid}")
    List<Map<String, String>> getComment(@Param("songid") String songId);
}
